package cate.common.table.item.kitchenware.row;

import cate.common.table.EExcelNoteField;
import cate.common.table.EExcelRowClass;
import cate.common.table.ERow;
import cate.common.table.item.IBagItemTpl;
import cp.solution.util.str.Str;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

@EExcelRowClass(IDTitle = "厨具ID")
public class KitchenwareBaseRow extends ERow implements IBagItemTpl {
    @EExcelNoteField(fieldName = "部位ID")
    public byte pos;
    @EExcelNoteField(fieldName = "厨具名称")
    public String name;
    @EExcelNoteField(fieldName = "厨具品质")
    public byte quality;
    @EExcelNoteField(fieldName = "技能组ID")
    private String skillGroupStr;
    @EExcelNoteField(fieldName = "星级")
    public int star;
    @EExcelNoteField(fieldName = "突破后厨具")
    public int breakTid;
    @EExcelNoteField(fieldName = "突破道具消耗")
    public String breakCostStr;
    @EExcelNoteField(fieldName = "突破消耗厨具数量")
    public int breakCostNum;

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int getTemplateId() {
        return id;
    }

    @Override
    public long getPileMax() {
        return 1;
    }

    @Override
    public boolean unique() {
        return true;
    }

    public List<Integer> skillGroup;

    @Override
    public void decode() {
        skillGroup = new ArrayList<>();
        if (StringUtils.isNotBlank(skillGroupStr)) {
            skillGroup = Str.strArr2intList(skillGroupStr.split(","));
        }
    }
}
